package com.gy.paidao.setting;

import android.content.Intent;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.gy.paidao.BaseActivity;
import com.gy.paidao.MyApplication;
import com.gy.paidao.R;
import com.gy.paidao.util.AnimUtil;

/**
 * @author GY
 * @date 16/2/26
 * @Description:隐私与安全
 */
public class PrivacySecurityActivity extends BaseActivity {

    public static final int SET_EMAIL = 102;
    public static final int SET_PHONE = 103;
    private LinearLayout ll_email, ll_phone_number, ll_reset_password, ll_block, ll_report_and_legal_rights;
    private TextView tv_email, tv_phone_number;
    private CheckBox cb_keep;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentViewRes(R.layout.activity_privacy_security);
        setViews();
    }

    @Override
    protected void initVariable() {

    }

    @Override
    protected void setTitleViews() {
        titleText.setText(this.getResources().getString(R.string.set_privacy_and_security));
    }

    @Override
    protected void setViews() {
        ll_email = (LinearLayout) findViewById(R.id.privacy_policy_ll_email);
        ll_phone_number = (LinearLayout) findViewById(R.id.privacy_policy_ll_phone_number);
        ll_reset_password = (LinearLayout) findViewById(R.id.privacy_policy_ll_reset_password);
        ll_block = (LinearLayout) findViewById(R.id.privacy_policy_ll_block);
        ll_report_and_legal_rights = (LinearLayout) findViewById(R.id.privacy_policy_ll_report_and_legal_rights);
        tv_email = (TextView) findViewById(R.id.privacy_policy_tv_email);
        tv_phone_number = (TextView) findViewById(R.id.privacy_policy_tv_phone_number);
        cb_keep = (CheckBox) findViewById(R.id.privacy_policy_cb_keep);

        ll_email.setOnClickListener(this);
        ll_phone_number.setOnClickListener(this);
        ll_reset_password.setOnClickListener(this);
        ll_block.setOnClickListener(this);
        ll_report_and_legal_rights.setOnClickListener(this);

        tv_email.setText(MyApplication.loginBean.email+"");
    }

    @Override
    protected void doClickAction(int viewId) {
        super.doClickAction(viewId);
        switch (viewId) {
            case R.id.title_ll_back:
                finish();
                AnimUtil.pushRightInAndOut(this);
                break;
            case R.id.privacy_policy_ll_reset_password:
                intent = new Intent(this,ReSetPwdActivity.class);
                startActivity(intent);
                AnimUtil.pushLeftInAndOut(this);
                break;
            case R.id.privacy_policy_ll_email:
//                intent = new Intent(this, SettingContentActivity.class);
//                intent.putExtra("title",getString(R.string.set_email));
//                intent.putExtra("into",SET_EMAIL);
//                startActivityForResult(intent, SET_EMAIL);
//                AnimUtil.pushLeftInAndOut(this);
                break;
            case R.id.privacy_policy_ll_phone_number:
                intent = new Intent(this, SettingContentActivity.class);
                intent.putExtra("title",getString(R.string.set_phone_number));
                intent.putExtra("into",SET_PHONE);
                startActivityForResult(intent, SET_PHONE);
                AnimUtil.pushLeftInAndOut(this);
                break;
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (resultCode){
            case SET_EMAIL:

                break;
            case SET_PHONE:

                break;
        }
        super.onActivityResult(requestCode, resultCode, data);

    }
}
